<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <title></title>
    <script type="text/javascript" charset="utf-8" src="../ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="../third-party/jquery-1.10.2.js"></script>
    
    <!--  -->
    <script type="text/javascript" charset="utf-8" src="../editor_api.js"></script>
    
    <script type="text/javascript" charset="utf-8" src="../third-party/kityformula-plugin/addKityFormulaDialog.js"></script>
    <script type="text/javascript" charset="utf-8" src="../third-party/kityformula-plugin/getKfContent.js"></script>
    <script type="text/javascript" charset="utf-8" src="../third-party/kityformula-plugin/defaultFilterFix.js"></script>
</head>
<body>
<h1>UEditor多实例</h1>
<div class="content1" style="width: 800px;height: 500px;border: 1px solid;" onclick="showedit(this)"></div>

<div class="content2" style="width: 600px;height: 400px;margin-top: 30px;border: 1px solid;" onclick="showedit(this)"></div>
<!--style给定宽度可以影响编辑器的最终宽度-->
<div id="show1" style="position: absolute;">
	<script type="text/plain" id="myEditor1" style="width: 800px;height: 500px;">
</script>
</div>
<div id="show2" style="position: absolute;">
	<script type="text/plain" id="myEditor2" style="width: 600px;height: 400px;">
    <p>这里我可以写一些输入提示</p>
</script>
</div>
<!--  
<script type="text/plain" id="myEditor3" style="margin-bottom:100px;">
</script>
-->
<script type="text/javascript">
    UE.getEditor('myEditor1', {
        theme:"default", //皮肤
        lang:'zh-cn', //语言
        isShow:false,
        toolbars: [[
			 'underline', 'forecolor', 'scrawl', 'simpleupload', 'kityformula', 'inserttable'
		]]
    });
UE.getEditor('myEditor1').hide();
    UE.getEditor('myEditor2', {
        autoClearinitialContent:true, //focus时自动清空初始化时的内容
        wordCount:false, //关闭字数统计
        elementPathEnabled:false,//关闭elementPath
        isShow:false
    });
UE.getEditor('myEditor2').hide();

//    UE.getEditor('myEditor3', {
        //toolbars:[['FullScreen', 'Source', 'Undo', 'Redo','Bold']],//这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
//        lang:"en"
        //更多其他参数，请参考ueditor.config.js中的配置项
 ///   });
//UE.getEditor('myEditor3').hide();
function showedit(obj){
	var top = 0;
	var left = 0;
	//if($.browser.msie){
		top = document.documentElement.scrollTop;
		left = document.documentElement.scrollLeft;
	//}else{
	//	top = document.body.scrollTop;
	//	left = document.body.scrollLeft;
	//}
	var className = $(obj).attr("class");
	if(className.indexOf("content1")>=0){
		var tar = $("#show1");
		tar.css('top',obj.getBoundingClientRect().top+top-30);
		tar.css('left',obj.getBoundingClientRect().left+left);
		tar.show();
		var content = $(obj).html();
		UE.getEditor('myEditor1').reset();
		UE.getEditor('myEditor1').setShow();
		if(content){
			UE.getEditor('myEditor1').setContent(content);
		}
	}else if(className.indexOf("content2")>=0){
		var tar = $("#show2");
		tar.css('top',obj.getBoundingClientRect().top+top-32);
		tar.css('left',obj.getBoundingClientRect().left+left);
		tar.show();
		var content = $(obj).html();
		UE.getEditor('myEditor2').reset();
		UE.getEditor('myEditor2').setShow();
		if(content){
			UE.getEditor('myEditor2').setContent(content);
		}
//-----------------------------------------------------------------------------
//		var tar = $("#editor_optons");
//		tar.css('top',obj.getBoundingClientRect().top+top-32);
//		tar.css('left',obj.getBoundingClientRect().left+left);
//		tar.show();
//		var content = $(obj).html();
//		UE.getEditor('editor_question_content',{
//				initialFrameWidth : 600,
//        		initialFrameHeight: 600
//		});
//		UE.getEditor('editor_question_content').setShow();
	}
	tarObj = obj;
}
</script>

</body>


</html>
